﻿<%@ Page Language="C#" MasterPageFile="~/cms/defaultLayout.master" AutoEventWireup="true" CodeFile="default.aspx.cs" Inherits="cms_default" %>
<%@ MasterType  virtualPath="~/cms/defaultLayout.master"%>
<asp:Content ID="mainContent" ContentPlaceHolderID="main" runat="server">
        <div class="content">
           <div class="buttons"><center>
                <a id="A1" class="" runat="server" href="~/cms/film"><asp:Label ID="lblFilm" runat="server"/>[Film]</a> -
                <a id="A2" class="" runat="server" href="~/cms/planning"><asp:Label ID="lblplanning" runat="server" />[Planning]</a> -
                <a id="A3" class="" runat="server" href="~/cms/account"><asp:Label ID="lblAccount" runat="server"/>[Account]</a> -
                <a id="A4" class="" runat="server" href="~/cms/abonnement"><asp:Label ID="lblAbonnement" runat="server" />[Abonnement]</a> -
                <a id="A5" class="" runat="server" href="~/cms/zaal"><asp:Label ID="lblZaal" runat="server"/>[Zaal]</a> -
                <a id="A6" class="" runat="server" href="~/cms/vestiging"><asp:Label ID="lblVestiging" runat="server" /><b>[Vestiging]</b></a> -
                <a id="A7" class="" runat="server" href="~/cms/user"><asp:Label ID="lblUser" runat="server"/>[User]</a> - 
               <a id="A8" class="" runat="server" href="~/cms/kaarten"><asp:Label ID="lblKaarten" runat="server"/>[Kaarten]</a>
                </center>
            </div>
            <p>This is "Vestiging" of CMS</p>
            <form id="vestiging_form" runat="server">
            <div class="cms_view" dir="ltr">
                 <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="New" />&nbsp;
                 <asp:Button ID="Button2" runat="server" Text="Cancel" OnClick="Button2_Click" />&nbsp;
                     <br /><br />
                <asp:GridView ID="vestigingGridView" runat="server" BackColor="White" OnSelectedIndexChanged="vestigingGridView_SelectedIndexChanged" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" DataSourceID="vestigingData" DataKeyNames="bioscoop_id" ForeColor="Black" GridLines="Vertical">
                    <AlternatingRowStyle BackColor="#CCCCCC"></AlternatingRowStyle>
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" ButtonType="Button"/>
                    </Columns>
                    <FooterStyle BackColor="#CCCCCC" />
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#808080" />
                <SortedDescendingCellStyle BackColor="#CAC9C9" />
                <SortedDescendingHeaderStyle BackColor="#383838" />
            </asp:GridView>
<br />
                <hr />
                <br />

            <asp:EntityDataSource ID="vestigingData" runat="server" 
                ConnectionString="name=debioscoopEntities" 
                DefaultContainerName="debioscoopEntities" 
                EnableDelete="True" 
                EnableFlattening="False" 
                EnableInsert="True" 
                EnableUpdate="True" 
                EntitySetName="bioscoops">       
            </asp:EntityDataSource>

            <asp:EntityDataSource ID="vestigingEntityFrameworkDatasource" runat="server" 
                ConnectionString="name=debioscoopEntities" 
                DefaultContainerName="debioscoopEntities" 
                EnableDelete="True" 
                EnableFlattening="False" 
                EnableInsert="True" 
                EnableUpdate="True" 
                EntitySetName="bioscoops"
                Where="it.bioscoop_id = @bioscoop_id">       
                        <WhereParameters>
                          <asp:ControlParameter ControlID="vestigingGridView" PropertyName="SelectedValue" Name="bioscoop_id" Type="Int32"></asp:ControlParameter>
                </WhereParameters> 
            </asp:EntityDataSource>

                <asp:DetailsView OnItemInserted="Refresh" OnItemDeleted="Refresh" OnItemUpdated="Refresh" ID="vestigingDetailsView" runat="server" DataSourceID="vestigingEntityFrameworkDatasource" Height="50px" Width="125px" AutoGenerateRows="False" DataKeyNames="bioscoop_id" CellPadding="4" ForeColor="#333333" GridLines="Horizontal">
                    <AlternatingRowStyle BackColor="White"></AlternatingRowStyle>

                    <CommandRowStyle BackColor="#C5BBAF" Font-Bold="True"></CommandRowStyle>

                    <EditRowStyle BackColor="#7C6F57"></EditRowStyle>
                    <InsertRowStyle BackColor="#669999" />
                    <FieldHeaderStyle BackColor="#D0D0D0" Font-Bold="True"></FieldHeaderStyle>
                    <Fields>
                       <asp:BoundField DataField="bioscoop_id" HeaderText="bioscoop_id" ReadOnly="True" InsertVisible="False" SortExpression="bioscoop_id"></asp:BoundField>
                        <asp:TemplateField HeaderText="naam" SortExpression="naam">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtNaam" runat="server" Text='<%# Bind("naam") %>'></asp:TextBox>
                                <asp:CompareValidator ID="naamCompareValidator" runat="server" Display="Dynamic" ControlToValidate="txtNaam" Type="String" Operator="DataTypeCheck" ErrorMessage="Er mogen alleen letters ingevoerd worden." ForeColor="Red"></asp:CompareValidator>
                                <asp:RequiredFieldValidator Display="Dynamic" ID="naamRequiredValidator" runat="server" ControlToValidate="txtNaam" ErrorMessage="Dit veld moet ingevuld zijn." ForeColor="Red"></asp:RequiredFieldValidator>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <asp:TextBox ID="txtNaam" runat="server" Text='<%# Bind("naam") %>'></asp:TextBox>
                                <asp:CompareValidator ID="naamCompareValidator" runat="server" Display="Dynamic" ControlToValidate="txtNaam" Type="String" Operator="DataTypeCheck" ErrorMessage="Er mogen alleen letters ingevoerd worden." ForeColor="Red"></asp:CompareValidator>
                                <asp:RequiredFieldValidator Display="Dynamic" ID="naamRequiredValidator" runat="server" ControlToValidate="txtNaam" ErrorMessage="Dit veld moet ingevuld zijn." ForeColor="Red"></asp:RequiredFieldValidator>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblNaam" runat="server" Text='<%# Bind("naam") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="straat" SortExpression="straat">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtStraat" runat="server" Text='<%# Bind("straat") %>'></asp:TextBox>
                                <asp:CompareValidator ID="straatCompareValidator" runat="server" Display="Dynamic" ControlToValidate="txtStraat" Type="String" Operator="DataTypeCheck" ErrorMessage="Er mogen alleen letters ingevoerd worden." ForeColor="Red"></asp:CompareValidator>
                                <asp:RequiredFieldValidator Display="Dynamic" ID="straatRequiredValidator" runat="server" ControlToValidate="txtStraat" ErrorMessage="Dit veld moet ingevuld zijn." ForeColor="Red"></asp:RequiredFieldValidator>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <asp:TextBox ID="txtStraat" runat="server" Text='<%# Bind("straat") %>'></asp:TextBox>
                                <asp:CompareValidator ID="straatCompareValidator" runat="server" Display="Dynamic" ControlToValidate="txtStraat" Type="String" Operator="DataTypeCheck" ErrorMessage="Er mogen alleen letters ingevoerd worden." ForeColor="Red"></asp:CompareValidator>
                                <asp:RequiredFieldValidator Display="Dynamic" ID="straatRequiredValidator" runat="server" ControlToValidate="txtStraat" ErrorMessage="Dit veld moet ingevuld zijn." ForeColor="Red"></asp:RequiredFieldValidator>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="txtStraat" runat="server" Text='<%# Bind("straat") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="huisnummer" SortExpression="huisnummer">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtHuisnummer" runat="server" Text='<%# Bind("huisnummer") %>'></asp:TextBox>
                                <asp:CompareValidator ID="huisnummerCompareValidator" runat="server" Display="Dynamic" ControlToValidate="txtHuisnummer" Type="Integer" Operator="DataTypeCheck" ErrorMessage="Er mogen alleen getallen ingevoerd worden." ForeColor="Red"></asp:CompareValidator>
                                <asp:RequiredFieldValidator Display="Dynamic" ID="huisnummerRequiredValidator" runat="server" ControlToValidate="txtHuisnummer" ErrorMessage="Dit veld moet ingevuld zijn." ForeColor="Red"></asp:RequiredFieldValidator>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <asp:TextBox ID="txtHuisnummer" runat="server" Text='<%# Bind("huisnummer") %>'></asp:TextBox>
                                <asp:CompareValidator ID="huisnummerCompareValidator" runat="server" Display="Dynamic" ControlToValidate="txtHuisnummer" Type="Integer" Operator="DataTypeCheck" ErrorMessage="Er mogen alleen getallen ingevoerd worden." ForeColor="Red"></asp:CompareValidator>
                                <asp:RequiredFieldValidator Display="Dynamic" ID="huisnummerRequiredValidator" runat="server" ControlToValidate="txtHuisnummer" ErrorMessage="Dit veld moet ingevuld zijn." ForeColor="Red"></asp:RequiredFieldValidator>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblHuisnummer" runat="server" Text='<%# Bind("huisnummer") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="postcode" SortExpression="postcode">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtPostcode" runat="server" Text='<%# Bind("postcode") %>'></asp:TextBox>
                                <asp:RequiredFieldValidator Display="Dynamic" ID="postcodeRequiredValidator" runat="server" ControlToValidate="txtPostcode" ErrorMessage="Dit veld moet ingevuld zijn." ForeColor="Red"></asp:RequiredFieldValidator>
                                  <asp:RegularExpressionValidator ID="validatePostcode"   Display="Dynamic" runat="server" ErrorMessage="De postcode heeft niet het juiste formaat." ControlToValidate="txtPostcode" ValidationExpression="^[1-9][0-9]{3}\s?[a-zA-Z]{2}$" />
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <asp:TextBox ID="txtPostcode" runat="server" Text='<%# Bind("postcode") %>'></asp:TextBox>
                                <asp:RequiredFieldValidator Display="Dynamic" ID="postcodeRequiredValidator" runat="server" ControlToValidate="txtPostcode" ErrorMessage="Dit veld moet ingevuld zijn." ForeColor="Red"></asp:RequiredFieldValidator>
                                  <asp:RegularExpressionValidator ID="validatePostcode"   Display="Dynamic" runat="server" ErrorMessage="De postcode heeft niet het juiste formaat." ControlToValidate="txtPostcode" ValidationExpression="^[1-9][0-9]{3}\s?[a-zA-Z]{2}$" />
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblPostcode" runat="server" Text='<%# Bind("postcode") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="telefoonnummer" SortExpression="telefoonnummer">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtTelefoonnummer" runat="server" Text='<%# Bind("telefoonnummer") %>'></asp:TextBox>
                                <asp:CompareValidator ID="telefoonnummerCompareValidator" runat="server" Display="Dynamic" ControlToValidate="txtTelefoonnummer" Type="Integer" Operator="DataTypeCheck" ErrorMessage="Er mogen alleen getallen ingevoerd worden." ForeColor="Red"></asp:CompareValidator>
                                <asp:RequiredFieldValidator Display="Dynamic" ID="telefoonnummerRequiredValidator" runat="server" ControlToValidate="txtTelefoonnummer" ErrorMessage="Dit veld moet ingevuld zijn." ForeColor="Red"></asp:RequiredFieldValidator>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <asp:TextBox ID="txtTelefoonnummer" runat="server" Text='<%# Bind("telefoonnummer") %>'></asp:TextBox>
                                <asp:CompareValidator ID="telefoonnummerCompareValidator" runat="server" Display="Dynamic" ControlToValidate="txtTelefoonnummer" Type="Integer" Operator="DataTypeCheck" ErrorMessage="Er mogen alleen getallen ingevoerd worden." ForeColor="Red"></asp:CompareValidator>
                                <asp:RequiredFieldValidator Display="Dynamic" ID="telefoonnummerRequiredValidator" runat="server" ControlToValidate="txtTelefoonnummer" ErrorMessage="Dit veld moet ingevuld zijn." ForeColor="Red"></asp:RequiredFieldValidator>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblTelefoonnummer" runat="server" Text='<%# Bind("telefoonnummer") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="email_adres" SortExpression="email_adres">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtEmailAdres" runat="server" Text='<%# Bind("email_adres") %>'></asp:TextBox>
                                <asp:RequiredFieldValidator Display="Dynamic" ID="emailadresRequiredValidator" runat="server" ControlToValidate="txtEmailAdres" ErrorMessage="Dit veld moet ingevuld zijn." ForeColor="Red"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="validateEmail"   Display="Dynamic" runat="server" ErrorMessage="Het emailadres heeft niet het juiste formaat." ControlToValidate="txtEmailAdres" ForeColor="Red" ValidationExpression="^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$" />
                              
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <asp:TextBox ID="txtEmailAdres" runat="server" Text='<%# Bind("email_adres") %>'></asp:TextBox>
                                <asp:RequiredFieldValidator Display="Dynamic" ID="emailadresRequiredValidator" runat="server" ControlToValidate="txtEmailAdres" ErrorMessage="Dit veld moet ingevuld zijn." ForeColor="Red"></asp:RequiredFieldValidator>
                                  <asp:RegularExpressionValidator ID="validateEmail"   Display="Dynamic" runat="server" ErrorMessage="Het emailadres heeft niet het juiste formaat."  ForeColor="Red" ControlToValidate="txtEmailAdres" ValidationExpression="^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$" />
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblEmailAdres" runat="server" Text='<%# Bind("email_adres") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="plaats" SortExpression="plaats">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtPlaats" runat="server" Text='<%# Bind("plaats") %>'></asp:TextBox>
                                <asp:CompareValidator ID="plaatsCompareValidator" runat="server" Display="Dynamic" ControlToValidate="txtPlaats" Type="String" Operator="DataTypeCheck" ErrorMessage="Er mogen alleen letters ingevoerd worden." ForeColor="Red"></asp:CompareValidator>
                                <asp:RequiredFieldValidator Display="Dynamic" ID="plaatsRequiredValidator" runat="server" ControlToValidate="txtPlaats" ErrorMessage="Dit veld moet ingevuld zijn." ForeColor="Red"></asp:RequiredFieldValidator>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <asp:TextBox ID="txtPlaats" runat="server" Text='<%# Bind("plaats") %>'></asp:TextBox>
                                <asp:CompareValidator ID="plaatsCompareValidator" runat="server" Display="Dynamic" ControlToValidate="txtPlaats" Type="String" Operator="DataTypeCheck" ErrorMessage="Er mogen alleen letters ingevoerd worden." ForeColor="Red"></asp:CompareValidator>
                                <asp:RequiredFieldValidator Display="Dynamic" ID="plaatsRequiredValidator" runat="server" ControlToValidate="txtPlaats" ErrorMessage="Dit veld moet ingevuld zijn." ForeColor="Red"></asp:RequiredFieldValidator>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblPlaats" runat="server" Text='<%# Bind("plaats") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" ButtonType="Button"/>
                    </Fields>
                    <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White"></FooterStyle>

                    <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White"></HeaderStyle>

                    <PagerStyle HorizontalAlign="Center" BackColor="#666666" ForeColor="White"></PagerStyle>

                    <RowStyle BackColor="#E3EAEB"></RowStyle>
                </asp:DetailsView>
            <br />
&nbsp;<div class="clearDiv"></div>
        </div>
        </form>
</asp:Content>
